package com.inwavetech.os.util.field;

import android.widget.Spinner;

import java.util.List;

/**
 * Created by jgskin on 2/14/14.
 */
public class SpinnerField implements Field {

    private final Spinner view;

    public SpinnerField(Spinner view) {
        this.view = view;
    }

    @Override
    public boolean isValid() {
        return true;
    }

    @Override
    public Object getValue() {
        AdapterItem item = (AdapterItem) view.getSelectedItem();

        return item.getValue();
    }

    @Override
    public void setValue(Object value) {
//            view.setSelection();
    }

    public interface AdapterItem {
        public String toString();

        public Object getValue();
    }

}